package thread;

/**
 * 线程
 */
public class ThreadInfoDemo {
    //
    public static void main(String[] args) {
        //
        Thread t1=Thread.currentThread();
        System.out.println(t1);
        doSome();
        Thread t2=new Thread(){
            public void run(){

                System.out.println("调用t2的线程:"+Thread.currentThread());
            }
        };
        t2.start();



    }
    public static void doSome(){
        Thread t1=Thread.currentThread();
        System.out.println("调用dosome的线程:"+t1);

        System.out.println("线程的名称："+t1.getName());
        System.out.println("线程的优先级："+t1.getPriority());
        System.out.println("线程的ID:"+t1.getId());

        System.out.println("线程是否活着："+t1.isAlive());
        System.out.println("线程是否是守护线程："+t1.isDaemon());
        System.out.println("线程是否是中断状态："+t1.isInterrupted());


    }
}
